<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script>
    var data=[
        {
            label: '中国',
            items: [
                {
                    label: '北京',
                    items: [
                        {
                            label: '朝阳区'
                        },
                        {
                            label: '宣武区'
                        },
                        {
                            label: '海淀区'
                        }
                    ]
                },
                {
                    label: '河北',
                    items: [
                        {
                            label: '石家庄'
                        },
                        {
                            label: '承德'
                        },
                        {
                            label: '唐山'
                        }
                    ]
                }
            ]
        },
        {
            label: '美国',
            items: [
                {
                    label: '纽约',
                    items: [
                        {
                            label: '曼哈顿区'
                        },
                        {
                            label: '皇后区'
                        }
                    ]
                },
                {
                    label: '德克萨斯州',
                    items: [
                        {
                            label: '休斯顿'
                        },
                        {
                            label: '达拉斯'
                        }
                    ]
                },
                {
                    label: '加利福尼亚州'
                }
            ]
        }
    ];

    function find(tree,item){
        console.group('Find');
        console.log('tree:',tree);
        var r;
        if(!tree)return null;
        for(var i=0;i<tree.length;i++){
            console.log('for curr:',tree[i]);
            if(tree[i]==item){
                return true;
            }else{
                r=find(tree[i].items,item);
                if(r){
                    return true;
                }
                console.log('find r:',r,tree[i]);
            }
        }
        console.log('find over:',tree);
        console.groupEnd('Find');
    }

    var item=data[1].items[1].items[1];
    console.info(item);

    console.log(find(data,item));
</script>
</body>
</html>